﻿/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkGbUtil.h"
#include "MkUtil/MkLog.h"

CMkGbRequest::CMkGbRequest(const MkGbRequestType& Event)
    : m_RequestType(Event)
{

}

CMkGbResponse::CMkGbResponse()
{

}

CMkGbMessageRequest::CMkGbMessageRequest()
    : CMkGbRequest(MkGbRequestMessage)
{

}

CMkGbSubscribeRequest::CMkGbSubscribeRequest()
    : CMkGbRequest(MkGbRequestSubscribe)
{

}

CMkGbNotifyRequest::CMkGbNotifyRequest()
    : CMkGbRequest(MkGbRequestNotify)
{

}

CMkGbInviteReqeust::CMkGbInviteReqeust()
    : CMkGbRequest(MkGbRequestInvite)
{

}

CMkGbByeReqeust::CMkGbByeReqeust()
    : CMkGbRequest(MkGbRequestBye)
{

}

CMkGbAckReqeust::CMkGbAckReqeust()
    : CMkGbRequest(MkGbRequestAck)
{

}

CMkGbInviteInfoRequest::CMkGbInviteInfoRequest()
    : CMkGbRequest(MkGbRequestInviteInfo)
    , m_fSleep(1.0)
    , m_ControlType(MkGbPlayControlInvalid)
    , m_DragSecond(0)
{

}

CMkGbMessageResponse::CMkGbMessageResponse()
    : m_SumNum(0)
{

}

CMkGbSubscribeResponse::CMkGbSubscribeResponse()
{

}

CMkGbNotifyResponse::CMkGbNotifyResponse()
{

}

CMkGbInviteInfoResponse::CMkGbInviteInfoResponse()
    : m_fSleep(1.0)
    , m_ControlType(MkGbPlayControlInvalid)
    , m_DragSecond(0)
{

}

CMkGbDeviceAuthorRequest::CMkGbDeviceAuthorRequest()
    : CMkGbRequest(MkGbRequestDeviceAuthor)
{

}

CMkGbDeviceAuthorResponse::CMkGbDeviceAuthorResponse()
{

}


CMkGbInviteResponse::CMkGbInviteResponse()
{

}

//CMkGbUtil CMkGbUtil::m_Instance;
//CMkGbUtil::CMkGbUtil()
//{
//    m_MapDeviceConfig["BasicParam"] = MkGbDeviceConfigBasicParam;
//    m_MapDeviceConfig["VideoParamOpt"] = MkGbDeviceConfigVideoParamOpt;
//    m_MapDeviceConfig["SVACEncodeConfig"] = MkGbDeviceConfigSvacDecode;
//    m_MapDeviceConfig["SVACDecodeConfig"] = MkGbDeviceConfigSvacEncode;
//    m_MapDeviceConfig["VideoParamAttribute"] = MkGbDeviceConfigVideoParamAttribute;
//    m_MapDeviceConfig["VideoRecordPlan"] = MkGbDeviceConfigVideoRecordPlan;
//    m_MapDeviceConfig["VideoAlaramRecord"] = MkGbDeviceConfigVideoAlaramRecord;
//    m_MapDeviceConfig["PictureMask"] = MkGbDeviceConfigPictureMask;
//    m_MapDeviceConfig["FrameMirror"] = MkGbDeviceConfigFrameMirror;
//    m_MapDeviceConfig["AlarmReport"] = MkGbDeviceConfigAlarmReport;
//    m_MapDeviceConfig["OSDConfig"] = MkGbDeviceConfigOSDConfig;
//    m_MapDeviceConfig["SnapShotConfig"] = MkGbDeviceConfigSnapShotConfig;
//
//    m_MapPtzCommand["PtzStop"] = MkGbPtzStop;
//    m_MapPtzCommand["PtzUp"] = MkGbPtzUp;
//    m_MapPtzCommand["PtzDown"] = MkGbPtzDown;
//    m_MapPtzCommand["PtzLeft"] = MkGbPtzLeft;
//    m_MapPtzCommand["PtzRight"] = MkGbPtzRight;
//    m_MapPtzCommand["PtzLeftUp"] = MkGbPtzLeftUp;
//    m_MapPtzCommand["PtzLeftDown"] = MkGbPtzLeftDown;
//    m_MapPtzCommand["PtzRightUp"] = MkGbPtzRightUp;
//    m_MapPtzCommand["PtzRightDown"] = MkGbPtzRightDown;
//    m_MapPtzCommand["PtzNear"] = MkGbPtzNear;
//    m_MapPtzCommand["PtzFar"] = MkGbPtzFar;
//    m_MapPtzCommand["PtzZoomIn"] = MkGbPtzZoomIn;
//    m_MapPtzCommand["PtzZoomOut"] = MkGbPtzZoomOut;
//    m_MapPtzCommand["PtzApertuerBig"] = MkGbPtzApertuerBig;
//    m_MapPtzCommand["PtzApertuerSmall"] = MkGbPtzApertuerSmall;
//    m_MapPtzCommand["PtzSetPreset"] = MkGbPtzSetPreset;
//    m_MapPtzCommand["PtzCallPreset"] = MkGbPtzCallPreset;
//    m_MapPtzCommand["PtzClearPreset"] = MkGbPtzClearPreset;
//    m_MapPtzCommand["PtzAddCruise"] = MkGbPtzAddCruise;
//    m_MapPtzCommand["PtzDelCruise"] = MkGbPtzDelCruise;
//    m_MapPtzCommand["PtzCruiseSpeed"] = MkGbPtzCruiseSpeed;
//    m_MapPtzCommand["PtzCruiseStayTime"] = MkGbPtzCruiseStayTime;
//    m_MapPtzCommand["PtzRunCruise"] = MkGbPtzRunCruise;
//    m_MapPtzCommand["PtzRunAutoScan"] = MkGbPtzRunAutoScan;
//    m_MapPtzCommand["PtzAutoScanSpeed"] = MkGbPtzAutoScanSpeed;
//    m_MapPtzCommand["PtzSwithOn"] = MkGbPtzSwithOn;
//    m_MapPtzCommand["PtzSwitchOff"] = MkGbPtzSwitchOff;
//
//    m_MapMessageType[MkGbMessageSetBasicParam] = "BasicParam";
//    m_MapMessageType[MkGbMessageSetSvacEncodeConfig] = "SVACEncodeConfig";
//    m_MapMessageType[MkGbMessageSetSvacDecodeConfig] = "SVACDecodeConfig";
//    m_MapMessageType[MkGbMessageSetVideoParamAttribute] = "VideoParamAttribute";
//    m_MapMessageType[MkGbMessageSetVideoRecordPlan] = "VideoRecordPlan";
//    m_MapMessageType[MkGbMessageSetAlarmRecord] = "VideoAlaramRecord";
//    m_MapMessageType[MkGbMessageSetPictureMask] = "PictureMask";
//    m_MapMessageType[MkGbMessageSetFrameMirror] = "FrameMirror";
//    m_MapMessageType[MkGbMessageSetAlarmReport] = "AlarmReport";
//    m_MapMessageType[MkGbMessageSetOsdConfig] = "OSDConfig";
//    m_MapMessageType[MkGbMessageSetSnapShotConfig] = "SnapShotConfig";
//
//    m_MapMessageType[MkGbMessageGetDeviceStatus] = "DeviceStatus";
//    m_MapMessageType[MkGbMessageGetCatalog] = "Catalog";
//    m_MapMessageType[MkGbMessageGetDeviceInfo] = "DeviceInfo";
//    m_MapMessageType[MkGbMessageGetRecordInfo] = "RecordInfo";
//    m_MapMessageType[MkGbMessageGetDeviceConfig] = "ConfigDownload";
//    m_MapMessageType[MkGbMessageGetPreset] = "PresetQuery";
//    m_MapMessageType[MkGbMessageGetHomePosition] = "HomePositionQuery";
//    m_MapMessageType[MkGbMessageGetCruiseTrackList] = "CruiseTrackListQuery";
//    m_MapMessageType[MkGbMessageGetCruiseTrack] = "CruiseTrackQuery";
//    m_MapMessageType[MkGbMessageGetPtzPosition] = "PTZPosition";
//    m_MapMessageType[MkGbMessageGetSdCardStatus] = "SDCardStatus";
//
//    m_MapMessageType[MkGbMessageBroadcast] = "Broadcast";
//    m_MapMessageType[MkGbMessageAlarmSubscribe] = "Alarm";
//    m_MapMessageType[MkGbMessageCatalogSubscribe] = "Catalog";
//    m_MapMessageType[MkGbMessageMobilePositionSubscribe] = "MobilePosition";
//    m_MapMessageType[MkGbMessagePtzPositionSubscribe] = "PTZPosition";
//}
//
//const MkString& CMkGbUtil::GetStringMessageType(const MkGbMessageType& MessageType) const
//{
//    MkUnorderedMap<Uint32, MkString>::const_iterator it = m_MapMessageType.find(MessageType);
//    if (it != m_MapMessageType.end()) {
//        return it->second;
//    }
//    return m_EmptyString;
//}
//
//const MkString& CMkGbUtil::GetStringDeviceConfigType(const MkGbDeviceConfigType& ConfigType) const
//{
//    MkUnorderedMap<MkString, MkGbDeviceConfigType>::const_iterator it = m_MapDeviceConfig.begin();
//    for (; it != m_MapDeviceConfig.end(); it++) {
//        if (ConfigType == it->second) {
//            return it->first;
//        }
//    }
//    return m_EmptyString;
//}
//
//const MkString& CMkGbUtil::GetStringPtzCmd(const MkGbPtzCommandType& GbType) const
//{
//    MkUnorderedMap<MkString, MkGbPtzCommandType>::const_iterator it = m_MapPtzCommand.begin();
//    for (; it != m_MapPtzCommand.end(); it++) {
//        if (GbType == it->second) {
//            return it->first;
//        }
//    }
//    return m_EmptyString;
//}
//
//Uint32 CMkGbUtil::GetGbPtzCmdType(const MkString& strType, MkGbPtzCommandType& GbType) const
//{
//    MkUnorderedMap<MkString, MkGbPtzCommandType>::const_iterator it = m_MapPtzCommand.find(strType);
//    if (it == m_MapPtzCommand.end()) {
//        MkErrorLog("input invalid cmdType:%s\n", strType.c_str());
//        return InvalidParams;
//    }
//    GbType = it->second;
//    return NoneError;
//}
//
//Uint32 CMkGbUtil::GetGbDeviceConfigType(const MkString& strType, MkGbDeviceConfigType& GbType) const
//{
//    MkUnorderedMap<MkString, MkGbDeviceConfigType>::const_iterator it = m_MapDeviceConfig.find(strType);
//    if (it == m_MapDeviceConfig.end()) {
//        MkErrorLog("input invalid config type:%s\n", strType.c_str());
//        return InvalidParams;
//    }
//    GbType = it->second;
//    return NoneError;
//}
//
//Uint32 CMkGbUtil::GetGbControlType(const MkString& strType, MkGbPlayControlType& GbType) const
//{
//    MkUnorderedMap<MkString, MkGbPlayControlType>::const_iterator it = m_MapPlayControlType.find(strType);
//    if (it == m_MapPlayControlType.end()) {
//        MkErrorLog("input invalid resulotion type:%s\n", strType.c_str());
//        return InvalidParams;
//    }
//    GbType = it->second;
//    return NoneError;
//}

//CMkGbUtil::~CMkGbUtil()
//{
//
//}

CMkGbRequest::~CMkGbRequest()
{

}

CMkGbResponse::~CMkGbResponse()
{

}